#include "modedialog.h"
#include "ui_modedialog.h"

ModeDialog::ModeDialog(QWidget *parent) :
    QDialog(parent),
    IDialog(),
    ui(new Ui::ModeDialog)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::FramelessWindowHint);
    this->setGeometry(this->getCenter(this->geometry().width(),this->geometry().height()));
}

ModeDialog::~ModeDialog()
{
    delete ui;
}

void ModeDialog::on_Btn_OK_clicked()
{
    setAnalysisMode();
    setBloodMode();
    this->accept();
}

void ModeDialog::on_Btn_cancel_clicked()
{
    this->reject();
}

void ModeDialog::setAnalysisMode()
{
    if(ui->raBtn_CBC->isChecked())
        analysisMode = "CBC";
    else if(ui->raBtn_CBCDIFF->isChecked())
        analysisMode = "CBCDIFF";
}

void ModeDialog::setBloodMode()
{
    if(ui->raBtn_allblood->isChecked())
        bloodMode = QString(tr("全血"));
    else if(ui->raBtn_dilute->isChecked())
        bloodMode = QString(tr("预稀释"));
    else if(ui->raBtn_moshaoblood->isChecked())
        bloodMode = QString(tr("末梢血"));
}

QString ModeDialog::getAnalysisMode()
{
    return analysisMode;
}

QString ModeDialog::getBloodMode()
{
    return bloodMode;
}






